<template>
  <div class="hello">
  <el-table
    :data="newslist"
    style="width: 100%"
    :default-sort = "{prop: 'date', order: 'descending'}"
    >
    <el-table-column
      prop="fstart"
      label="日期"
      sortable
      width="180">
    </el-table-column>
    <el-table-column
      prop="kehu"
      label="姓名"
      sortable
      width="180">
    </el-table-column>
    <el-table-column
      prop="address"
      label="地址"
      :formatter="formatter">
    </el-table-column>
  </el-table>

  </div>
</template>

<script>
export default {
  name: 'HelloWorld',
  data () {
    return {
      newslist:[]
    }
  },
    created:function (){
    this.$axios.get('/v1/word/')
      //成功返回
      .then(response=>{
      	this.newslist = response.data.data;
         console.log(response);
      })
      //失败返回
      .catch(error=>{
          console.log(error);
      })
 }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
  font-weight: normal;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
